﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Tasks;

namespace PreferredZhiTu.Views
{
    public partial class Share : PhoneApplicationPage
    {
        public Share()
        {
            InitializeComponent();
        }

        private void ApplicationBarIconButton_Click(object sender, EventArgs e)
        {//短信分享
            SmsComposeTask sms = new SmsComposeTask();
            sms.Body = textBox1.Text;
            sms.To = "";
            sms.Show();
        }

        private void ApplicationBarIconButton_Click_1(object sender, EventArgs e)
        {//邮件分享
            EmailComposeTask email = new EmailComposeTask();
            email.Bcc = "";//密件抄送行的收件人
            email.Body = textBox1.Text;
            email.Cc = "";//抄送行的收件人
            email.Subject = "";//主题
            email.To = "";//收件人
            email.Show();
        }

        public void EnterWeb(string web)
        {
            if (textBox1.Text != "")
            {
                WebBrowserTask browser = new WebBrowserTask();
                browser.Uri = new Uri(web);
                browser.Show();
            }
        }
        private const string qq = "http://qzone.qq.com/"; 
        private void ApplicationBarMenuItem_Click(object sender, EventArgs e)
        { //分享到QQ空间
            EnterWeb(qq); 
        }
        private const string weibo = "http://t.qq.com/";
        private void ApplicationBarMenuItem_Click_1(object sender, EventArgs e)
        {//分享到微博
            EnterWeb(weibo);
        }
        private const string renren = "http://www.renren.com/GLogin.do";
        private void ApplicationBarMenuItem_Click_2(object sender, EventArgs e)
        {//分享到人人
            EnterWeb(renren);
        }
        private const string xinlang = "http://weibo.com/?c=spr_web_mthz_sogou_weibo_t001";
        private void ApplicationBarMenuItem_Click_3(object sender, EventArgs e)
        {//分享到新浪
            EnterWeb(xinlang);
        }


    }
}